package comm.util;

import java.sql.SQLException;

import statics.PalmVars;

import com.ibatis.sqlmap.client.SqlMapClient;
import comm.util.SqlMapLoader;

public class DbTest {
	public DbTest(){}
	
	private SqlMapClient sqlMapper = SqlMapLoader.getInstance();
	
	public String testDbConnection(){
		String result = PalmVars.FAIL;
		try {
			String resultQuery = sqlMapper.queryForObject("dbtest.testDbConnection").toString();
			if(resultQuery.length()>2)result=PalmVars.SUCCESS;
		} catch (SQLException e) {
			return result;
		}
		return result;
	}
}
